home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / dvlprstc.hqx / Developer Stack 1.3r / card_21264.txt < prev    next >
Encoding:
Text File  |  1991-04-30  |  1.9 KB  |  78 lines

  1. -- card: 21264 from stack: in.3r
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2612
  5. -- name: TitleBar
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A004
  11. -- rect: left=200 top=234 right=283 bottom=265
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 27056 / 27056
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Try it...
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   put loc of card window into origLoc
  23.   if item 2 of origLoc<=20 then set loc of card window to 0,20
  24.   put "ok" into again
  25.   repeat until again is "cancel"
  26.     Answer "Click 'Ok' to toggle the titleBar..." with "Ok" or "Cancel"
  27.     put it into again
  28.     if again is "Ok" then
  29.       titleBar
  30.       go to this card
  31.     end if
  32.   end repeat
  33.   titleBar show
  34.   set loc of card window to origLoc
  35. end mouseUp
  36.  
  37.  
  38.  
  39. -- part contents for background part 13
  40. ----- text -----
  41. 34
  42.  
  43. -- part contents for background part 2
  44. ----- text -----
  45. TitleBar
  46.  
  47. -- part contents for background part 3
  48. ----- text -----
  49.  
  50. TitleBar is an XCMD which allows you to hide or show the title bar on HyperCard's main window. 
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. -- part contents for background part 30
  58. ----- text -----
  59. XCMD
  60.  
  61. -- part contents for background part 10
  62. ----- text -----
  63.  
  64. Syntax:
  65.  
  66.   TitleBar <mode>
  67.  
  68.  TitleBar accepts one parameter <mode>:
  69. <mode> can be:
  70. ΓÇó toggle -- toggles the titlebar
  71. ΓÇó hide -- hides the titlebar
  72. ΓÇó show -- shows the titlebar
  73. ΓÇó <default> -- same as toggle
  74.  
  75. TitleBar first checks to see if the parameter passed in is the same as the current state of the title bar. If it is, then TitleBar does nothing. Otherwise, TitleBar hides the window, then toggles the title bar, and finally shows the window. To toggle the title bar, TitleBar toggles the variation code of the window definition function
  76. (i.e. the windowDefProc) of HyperCardΓÇÖs main window between plainDBox and noGrowDocProc. 
  77.  
  78. See Inside Mac I-298 for more info on this concept.